<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="__STATIC__/admin/css/font.css">
<link rel="stylesheet" href="__STATIC__/admin/css/xadmin.css">
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="__STATIC__/admin/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="__STATIC__/admin/js/xadmin.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/ykp.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/public.js"></script>
<div class="x-body">
    <div class="layui-tab-content">
        <div>
            <a title="编辑"   class="layui-btn layui-btn layui-btn-mini "
               onclick="editAgent('新增渠道代理','{:url('agent/add_person',['province'=>$province,'city'=>$city])}',900,500)"
               href="javascript:;">
                <i class="layui-icon">新增渠道商代理</i>
            </a>

        </div>
        <table class="layui-table">
            <thead>
            <tr>
                <th>ID</th>
                <th>省份</th>
                <th>城市</th>
                <th>姓名</th>
                <th>电话</th>
                <th>行业</th>
                <th>注册日期</th>
                <th>总投入lcb</th>
            </tr>
            </thead>
            <tbody class="tr-data">
            {volist name="user" id="vo"}
            <tr>
                <td>{$vo.uid}</td>
                <td>{$vo.province}</td>
                <td>{$vo.city}</td>
                <td>{$vo.nick_name}</td>
                <td>{$vo.phone}</td>
                <td>{$vo.job}</td>
                <td>{$vo.register_time|date="Y/m/d",###}</td>
                <td>{$vo.touru_money}</td>
            </tr>
            {/volist}
            </tbody>
        </table>

        <div class="page">
            {$user->render()}
        </div>
    </div>
    {include file="public/_footer" /}
    <script>
        layui.use('laydate', function () {
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate.render({
                elem: '#end' //指定元素
            });
        });

        /*用户-停用*/
        function member_stop(obj, id) {
            layer.confirm('确认要停用吗？', function (index) {

                if ($(obj).attr('title') == '启用') {

                    //发异步把用户状态进行更改
                    $(obj).attr('title', '停用')
                    $(obj).find('i').html('&#xe62f;');

                    $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
                    layer.msg('已停用!', {icon: 5, time: 1000});

                } else {
                    $(obj).attr('title', '启用')
                    $(obj).find('i').html('&#xe601;');

                    $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
                    layer.msg('已启用!', {icon: 5, time: 1000});
                }

            });
        }

        layui.use(['form', 'layer'], function () {
            $ = layui.jquery;
            var form = layui.form
                    , layer = layui.layer;
            var util = layui.util;


        });

        //城际联动
        var SCOPE = {
            "city_url": "{:url('admin/Advertuser/getCity')}",
        };

        $('.invite_code').on('click', function () {
            $('.show_code').show()
        })
        $('.cancel_invite_code').on('click', function () {
            $('.show_code').hide()
        })

        function editAgent(title,url,w,h){
            if (title == null || title == '') {
                title=false;
            };
            if (url == null || url == '') {
                url="404.html";
            };
            if (w == null || w == '') {
                w=($(window).width()*0.9);
            };
            if (h == null || h == '') {
                h=($(window).height() - 50);
            };
            layer.open({
                type: 2,
                area: [w + 'px', h + 'px'],
                fix: false, //不固定
                maxmin: true,
                shadeClose: true,
                shade: 0.4,
                title: title,
                content: url, end: function () {
                    javascript:location.replace(location.href);
                }
            });
        }


    </script>
    <script>var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();</script>
    </body>

    </html>